home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / g / gnu_c / incl98.zoo / falcon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-05  |  19.0 KB  |  636 lines

  1. /*
  2.  * GNU-C Bindings for Falcon XBIOS functions
  3.  * -- hyc 11-9-92 (uunet!hanauma.Jpl.Nasa.Gov!hyc)
  4.  */
  5.  
  6. #ifndef _FALCON_H
  7. #define _FALCON_H
  8.  
  9. #ifndef _OSBIND_H
  10. #include <osbind.h>
  11. #endif
  12.  
  13. #ifdef __LATTICE__
  14.  
  15. #define __F_TRAP {register d2,a2; "4e4e";}
  16.  
  17. void _vfv(int);
  18. char _bfv(int);
  19. short _sfv(int);
  20. long _lfv(int);
  21.  
  22. void _vfs(int, int);
  23. short _sfs(int, int);
  24. long _lfs(int, int);
  25.  
  26. void _vfss(int, int, int);
  27. long _lfss(int, int, int);
  28. void _vfll(int, long, long);
  29. void _vflp(int, long, void *);
  30.  
  31. void _vfssr(int, int, int, long *);
  32. void _vfssR(int, int, int, const long *);
  33. void _vfpls(int, void *, long, int);
  34. short _sflsp(int, long, int, void *);
  35. short _sfpls(int, void *, long, int);
  36. long _lfspp(int, int, void *, void *);
  37.  
  38. short _sfppss(int, void *, void *, int, int);
  39. void _vfllpp(int, long, long, void *, void *);
  40. void _vfplll(int, void *, long, long, long);
  41. void _vfplpl(int, void *, long, void *, long);
  42.  
  43. long _lfsssss(int, int, int, int, int, int);
  44.  
  45. void _vfppllll(int, void *, void *, long, long, long, long);
  46.  
  47.  
  48. #pragma inline _vfv((short))    __F_TRAP
  49. #pragma inline d0=_bfv((short))    __F_TRAP
  50. #pragma inline d0=_sfv((short))    __F_TRAP
  51. #pragma inline d0=_lfv((short))    __F_TRAP
  52.  
  53. #pragma inline _vfs((short),(short))    __F_TRAP
  54. #pragma inline d0=_sfs((short),(short))    __F_TRAP
  55. #pragma inline d0=_lfs((short),(short))    __F_TRAP
  56.  
  57. #pragma inline _vfss((short),(short),(short))    __F_TRAP
  58. #pragma inline d0=_lfss((short),(short),(short))    __F_TRAP
  59. #pragma inline _vfll((short),,)    __F_TRAP
  60. #pragma inline _vflp((short),,)    __F_TRAP
  61.  
  62. #pragma inline _vfssr((short),(short),(short),)    __F_TRAP
  63. #pragma inline _vfssR((short),(short),(short),)    __F_TRAP
  64. #pragma inline _vfpls((short),,,(short))    __F_TRAP
  65. #pragma inline d0=_sfpls((short),,,(short))    __F_TRAP
  66. #pragma inline d0=_sflsp((short),,(short),)    __F_TRAP
  67. #pragma inline d0=_lfspp((short),(short),,)    __F_TRAP
  68.  
  69. #pragma inline d0=_sfppss((short),,,(short),(short))    __F_TRAP
  70. #pragma inline _vfllpp((short),,,,)    __F_TRAP
  71. #pragma inline _vfplll((short),,,,)    __F_TRAP
  72. #pragma inline _vfplpl((short),,,,)    __F_TRAP
  73.  
  74. #pragma inline d0=_lfsssss((short),(short),(short),(short),(short),(short))    __F_TRAP
  75.  
  76. #pragma inline _vfppllll((short),,,,,)    __F_TRAP
  77.  
  78. #else /* !__LATTICE__ */
  79.  
  80. #ifndef trap_14_wwwwww
  81. #if __GNUC__ > 1
  82. #define trap_14_wwwwww(n,a,b,c,d,e)                    \
  83. __extension__                                \
  84. ({                                    \
  85.     register long retvalue __asm__("d0");                \
  86.     short _a = (short)(a);                        \
  87.     short _b = (short)(b);                        \
  88.     short _c = (short)(c);                        \
  89.     short _d = (short)(d);                        \
  90.     short _e = (short)(e);                        \
  91.                                     \
  92.     __asm__ volatile                        \
  93.     ("\
  94.         movw    %6,sp@-; \
  95.         movw    %5,sp@-; \
  96.         movw    %4,sp@-; \
  97.         movw    %3,sp@-; \
  98.         movw    %2,sp@-; \
  99.         movw    %1,sp@-; \
  100.         trap    #14; \
  101.         lea    sp@(12),sp"                    \
  102.     : "=r"(retvalue)                        \
  103.     : "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e)        \
  104.     : "d0", "d1", "d2", "a0", "a1", "a2", "memory");        \
  105.     retvalue;                            \
  106. })
  107. #else
  108. #define trap_14_wwwwww(n,a,b,c,d,e)                    \
  109. ({                                    \
  110.     register long retvalue __asm__("d0");                \
  111.     short _a = (short)(a);                        \
  112.     short _b = (short)(b);                        \
  113.     short _c = (short)(c);                        \
  114.     short _d = (short)(d);                        \
  115.     short _e = (short)(e);                        \
  116.                                     \
  117.     __asm__ volatile                        \
  118.     ("\
  119.         movw    %4,sp@-; \
  120.         movw    %3,sp@-; \
  121.         movw    %2,sp@-; \
  122.         movw    %1,sp@-; \
  123.         movw    %0,sp@- "                    \
  124.     :: "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e));        \
  125.                                     \
  126.     __asm__ volatile                        \
  127.     ("\
  128.         movw    %1,sp@-; \
  129.         trap    #14; \
  130.         lea    sp@(12),sp"                    \
  131.     : "=r"(retvalue)                        \
  132.     : "g"(n)                            \
  133.     : "d0", "d1", "d2", "a0", "a1", "a2");                \
  134.     retvalue;                            \
  135. })
  136. #endif
  137. #endif
  138.  
  139. #ifndef trap_14_wllll
  140. #define trap_14_wllll(n,a,b,c,d)                    \
  141. __extension__                                \
  142. ({                                    \
  143.     register long retvalue __asm__("d0");                \
  144.     long _a = (long)(a);                        \
  145.     long _b = (long)(b);                        \
  146.     long _c = (long)(c);                        \
  147.     long _d = (long)(d);                        \
  148.                                     \
  149.     __asm__ volatile                        \
  150.     ("\
  151.         movl    %5,sp@-; \
  152.         movl    %4,sp@-; \
  153.         movl    %3,sp@-; \
  154.         movl    %2,sp@-; \
  155.         movw    %1,sp@-; \
  156.         trap    #14; \
  157.         lea    sp@(18),sp"                    \
  158.     : "=r"(retvalue)                        \
  159.     : "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d)            \
  160.     : "d0", "d1", "d2", "a0", "a1", "a2", "memory");        \
  161.     retvalue;                            \
  162. })
  163. #endif
  164.  
  165. #ifndef trap_14_wllllll
  166. #define trap_14_wllllll(n,a,b,c,d,e,f)                    \
  167. __extension__                                \
  168. ({                                    \
  169.     register long retvalue __asm__("d0");                \
  170.     long _a = (long)(a);                        \
  171.     long _b = (long)(b);                        \
  172.     long _c = (long)(c);                        \
  173.     long _d = (long)(d);                        \
  174.     long _e = (long)(e);                        \
  175.     long _f = (long)(f);                        \
  176.                                     \
  177.     __asm__ volatile                        \
  178.     ("\
  179.         movl    %7,sp@-; \
  180.         movl    %6,sp@-; \
  181.         movl    %5,sp@-; \
  182.         movl    %4,sp@-; \
  183.         movl    %3,sp@-; \
  184.         movl    %2,sp@-; \
  185.         movw    %1,sp@-; \
  186.         trap    #14; \
  187.         lea    sp@(26),sp"                    \
  188.     : "=r"(retvalue)                        \
  189.     : "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e), "r"(_f)    \
  190.     : "d0", "d1", "d2", "a0", "a1", "a2", "memory");        \
  191.     retvalue;                            \
  192. })
  193. #endif
  194.  
  195. #ifndef trap_14_wll
  196. #define trap_14_wll(n,a,b)                        \
  197. __extension__                                \
  198. ({                                    \
  199.     register long retvalue __asm__("d0");                \
  200.     long _a = (long)(a);                        \
  201.     long _b = (long)(b);                        \
  202.                                     \
  203.     __asm__ volatile                        \
  204.     ("\
  205.         movl    %3,sp@-; \
  206.         movl    %2,sp@-; \
  207.         movw    %1,sp@-; \
  208.         trap    #14; \
  209.         lea    sp@(10),sp"                    \
  210.     : "=r"(retvalue)                        \
  211.     : "g"(n), "r"(_a), "r"(_b)                    \
  212.     : "d0", "d1", "d2", "a0", "a1", "a2", "memory");        \
  213.     retvalue;                            \
  214. })
  215. #endif
  216.  
  217. #ifndef trap_14_wlwl
  218. #define trap_14_wlwl(n,a,b,c)                        \
  219. __extension__                                \
  220. ({                                    \
  221.     register long retvalue __asm__("d0");                \
  222.     long _a = (long)(a);                        \
  223.     short _b = (short)(b);                        \
  224.     long _c = (long)(c);                        \
  225.                                     \
  226.     __asm__ volatile                        \
  227.     ("\
  228.         movl    %4,sp@-; \
  229.         movw    %3,sp@-; \
  230.         movl    %2,sp@-; \
  231.         movw    %1,sp@-; \
  232.         trap    #14; \
  233.         lea    sp@(12),sp"                    \
  234.     : "=r"(retvalue)                        \
  235.     : "g"(n), "r"(_a), "r"(_b), "r"(_c)                \
  236.     : "d0", "d1", "d2", "a0", "a1", "a2", "memory");        \
  237.     retvalue;                            \
  238. })
  239. #endif
  240.  
  241. #endif /* __LATTICE__ */
  242.  
  243. /*
  244.  * Video
  245.  */
  246.  
  247. /* Video mode codes */
  248.  
  249. #define    VERTFLAG    0x100    /* double-line on VGA, interlace on ST/TV */
  250. #define    STMODES        0x080    /* ST compatible */
  251. #define    OVERSCAN    0x040    /* Multiply X&Y rez by 1.2, ignored on VGA */
  252. #define    PAL        0x020    /* PAL if set, else NTSC */
  253. #define    VGA        0x010    /* VGA if set, else TV mode */
  254. #define    COL80        0x008    /* 80 column if set, else 40 column */
  255. #define    NUMCOLS        7    /* Mask for number of bits per pixel */
  256. #define    BPS16        4
  257. #define    BPS8        3
  258. #define    BPS4        2
  259. #define    BPS2        1
  260. #define    BPS1        0
  261.  
  262. /* Montype return values */
  263. enum montypes {STmono=0, STcolor, VGAcolor, TVcolor};
  264.  
  265. /* VsetSync flags - 0=internal, 1=external */
  266.  
  267. #define    VID_CLOCK    1
  268. #define    VID_VSYNC    2
  269. #define    VID_HSYNC    4
  270.  
  271. #undef Setscreen
  272.  
  273. #ifdef __LATTICE__
  274.  
  275. #define Setscreen(a, b, c, d) _sfppss(5, a, b, c, d)
  276. #define Vsetmode(a) _sfs(88, a)
  277. #define Montype() _sfv(89)
  278. #define VsetSync(a) _vfs(90)
  279. #define VgetSize(a) _lfs(91)
  280. #define VsetRGB(a, b, c) _vfssR(93, a, b, c)
  281. #define VgetRGB(a, b, c) _vfssr(94, a, b, c)
  282. #define VsetMask(a, b) _vfss(150, a, b)
  283.  
  284. #else /* !__LATTICE__ */
  285.  
  286.  
  287. #define Setscreen(lscrn,pscrn,rez,mode)                    \
  288.     (short)trap_14_wllww((short)5,(long)(lscrn),(long)(pscrn),    \
  289.         (short)(rez),(short)(mode))
  290. #define Vsetmode(mode)                            \
  291.     (short)trap_14_ww((short)88,(short)(mode))
  292. #define Montype()                            \
  293.     (short)trap_14_w((short)89)
  294. #define    VgetSize(mode)                            \
  295.     (long)trap_14_ww((short)91,(short)(mode))
  296. #define    VsetSync(ext)                            \
  297.     (void)trap_14_ww((short)90,(short)(ext))
  298. #define VsetRGB(index,count,array)                    \
  299.     (void)trap_14_wwwl((short)93,(short)(index),(short)(count),    \
  300.         (long *)(array))
  301. #define VgetRGB(index,count,array)                    \
  302.     (void)trap_14_wwwl((short)94,(short)(index),(short)(count),    \
  303.         (long *)(array))
  304. #define VsetMask(andmask,ormask)                    \
  305.     (short)trap_14_www((short)150,(short)(andmask),(short)(ormask))
  306.  
  307. #endif /* __LATTICE__ */
  308.  
  309. /*
  310.  * Sound
  311.  */
  312.  
  313. /* _SND cookie values */
  314.  
  315. #define SND_PSG        0x01    /* Yamaha PSG */
  316. #define    SND_8BIT    0x02    /* 8 bit DMA stereo */
  317. #define    SND_16BIT    0x04    /* 16 bit CODEC */
  318. #define    SND_DSP        0x08    /* DSP */
  319. #define    SND_MATRIX    0x10    /* Connection Matrix */
  320.  
  321. /* XXX Docs say Falcon shows 0x3f. What does bit 0x20 mean ??? */
  322.  
  323. /*
  324.  * Sound data memory layout - samples are all signed values
  325.  *
  326.  *                 (each char = 1 byte, 2 chars = 1 word)
  327.  * 1 16 bit stereo track:    LLRRLLRRLLRRLLRR
  328.  * 1 8 bit stereo track:    LRLRLRLR  
  329.  * 2 16 bit stereo tracks:    L0R0L1R1L0R0L1R1
  330.  *  etc...
  331.  */
  332.  
  333. /* Setbuffer regions */
  334.  
  335. #define    SR_PLAY        0    /* Set playback registers */
  336. #define    SR_RECORD    1    /* Set record registers */
  337.  
  338. /* Soundcmd Modes */
  339.  
  340. #define LTATTEN        0    /* Left-channel output attenuation */
  341. #define    RTATTEN        1    /* Right channel atten */
  342. #define    LTGAIN        2    /* Left input gain */
  343. #define    RTGAIN        3    /* Right channel gain */
  344.     /* gain and attenuation in 1.5db units, 0x00V0, V:0-15 */
  345. #define    ADDERIN        4    /* Select inputs to adder 0=off, 1=on */
  346. #define    ADCIN        1    /* Input from ADC */
  347. #define    MATIN        2    /* Input from connection matrix */
  348. #define    ADCINPUT    5    /* Select input to ADC, 0=mic, 1=PSG */
  349. #define    ADCRT        1    /* Right channel input */
  350. #define    ADCLT        2    /* Left input */
  351. #define    SETPRESCALE    6    /* Set TT compatibility prescaler */
  352. #define    PREMUTE        0    /* was /1280, now is invalid, mutes */
  353. #define    PRE1280        PREMUTE
  354. #define    PRE640        1    /* divide by 640 */
  355. #define    PRE320        2    /* / 320 */
  356. #define    PRE160        3    /* / 160 */
  357.  
  358. /* Record/Playback modes */
  359.  
  360. #define    STEREO8        0    /* 8 bit stereo */
  361. #define    STEREO16    1    /* 16 bit stereo */
  362. #define    MONO8        2    /* 8 bit mono */
  363.  
  364. /* Record/Playback tracks range from 0 to 3 */
  365.  
  366. /* XXX Doc for Settracks could be clearer. Can we individually set, e.g.,
  367.    tracks 0 & 2 for playback, or must track selections be contiguous? */
  368.  
  369. /* Sound buffer interrupts */
  370.     /* sources */
  371. #define    SI_TIMERA    0    /* Timer A interrupt */
  372. #define    SI_MFPI7    1    /* MFP interrupt 7 */
  373.     /* causes */
  374. #define    SI_NONE        0    /* No interrupts */
  375. #define    SI_PLAY        1    /* Intr at end of play buffer */
  376. #define    SI_RECORD    2    /* Intr at end of record buffer */
  377. #define    SI_BOTH        3    /* Interrupt for either play or record */
  378.  
  379. /* Buffoper flags */
  380.  
  381. #define    SB_PLA_ENA    1    /* Play enable */
  382. #define    SB_PLA_RPT    2    /* Play repeat (continuous loop mode) */
  383. #define    SB_REC_ENA    4    /* Record enable */
  384. #define SB_REC_RPT    8    /* Record repeat */
  385.  
  386. /* Dsptristate - 0=tristate, 1=enable */
  387.  
  388. /* Gpio modes */
  389.  
  390. #define    GPIO_SET    0    /* Set I/O direction, 0=in, 1=out */
  391. #define    GPIO_READ    1    /* Read bits - only 3 bits on gpio */
  392. #define    GPIO_WRITE    2    /* Write gpio data bits */
  393.  
  394. /* Devconnect (connection matrix) source devices */
  395.  
  396. #define    DMAPLAY        0    /* DMA playback */
  397. #define    DSPXMIT        1    /* DSP transmit */
  398. #define    EXTINP        2    /* External input */
  399. #define    ADC        3    /* Microphone/PSG, see Soundcmd(ADCINPUT) */
  400.  
  401. /* Devconnect destination devices, bitmapped */
  402.  
  403. #define    DMAREC        1    /* DMA record */
  404. #define    DSPRECV        2    /* DSP receive */
  405. #define    EXTOUT        4    /* External output */
  406. #define    DAC        8    /* Headphone, internal speaker, monitor */
  407.  
  408. /* Devconnect clock sources */
  409.  
  410. #define    CLK25M        0    /* Internal 25.175 MHz clock */
  411. #define    CLKEXT        1    /* External clock */
  412. #define    CLK32M        2    /* Internal 32 MHz. Invalid for CODEC */
  413.  
  414. /* Devconnect clock prescaler values */
  415.  
  416. /* XXX Doc lists incorrect hz numbers for many of these... */
  417.  
  418. #define CLKOLD        0    /* TT compatible, see Soundcmd(SETPRESCALE) */
  419. #define    CLK50K        1    /* 49170 hz */
  420. #define    CLK33K        2    /* 32780 hz */
  421. #define    CLK25K        3    /* 24585 hz */
  422. #define    CLK20K        4    /* 19668 hz */
  423. #define    CLK16K        5    /* 16390 hz */
  424.         /*    6    (14049 hz) invalid for CODEC */
  425. #define    CLK12K        7    /* 12292 hz */
  426.         /*    8    (10927 hz) invalid for CODEC */
  427. #define    CLK10K        9    /* 9834 hz */
  428.         /*    10    (8940 hz) invalid for CODEC */
  429. #define    CLK8K        11    /* 8195 hz */
  430.         /*    12    (7565 hz) invalid */
  431.         /*    13    (7024 hz) invalid */
  432.         /*    14    (6556 hz) invalid */
  433.         /*    15    (6146 hz) invalid */
  434.  
  435. /* Sndstatus command */
  436.  
  437. #define    SND_CHECK    0    /* Check current status */
  438. #define    SND_RESET    1    /* Reset sound system */
  439.     /*
  440.      * Reset effects: DSP tristated, gain=atten=0, matrix reset,
  441.      * ADDERIN=0, Mode=STEREO8, Play=Record=Monitor tracks=0,
  442.      * interrupts disabled, buffer operation disabled.
  443.      */
  444.  
  445. /* Sndstatus status return */
  446.  
  447. #define    SS_OK        0    /* No errors */
  448. #define    SS_CTRL        1    /* Invalid control field (Data assumed OK) */
  449. #define    SS_SYNC        2    /* Invalid sync format (mutes) */
  450. #define    SS_SCLK        3    /* Serial clock out of valid range (mutes) */
  451.  
  452. #define    SS_RTCLIP    0x10    /* Right channel is clipping */
  453. #define    SS_LTCLIP    0x20    /* Left channel is clipping */
  454.  
  455. /* Structure used by Buffptr */
  456.  
  457. typedef struct SndBufPtr {
  458.     char *play;
  459.     char *record;
  460.     long reserve1;
  461.     long reserve2;
  462. } SndBufPtr;
  463.  
  464. #ifdef __LATTICE__
  465.  
  466. long _lfS(int, SndBufPtr *);
  467. #pragma inline d0=_lfS((short),)    __F_TRAP
  468.  
  469. #define Locksnd() _lfv(128)
  470. #define Unlocksnd() _lfv(129)
  471. #define Soundcmd(a, b) _lfss(130, a, b)
  472. #define Setbuffer(a, b, c) _lfspp(131, a, b, c)
  473. #define Setmode(a) _lfs(132, a)
  474. #define Settracks(a, b) _lfss(133, a, b)
  475. #define Setmontracks(a) _lfs(134, a)
  476. #define Setinterrupt(a, b) _lfss(135, a, b)
  477. #define Buffoper(a) _lfs(136, a)
  478. #define Dsptristate(a, b) _lfss(137, a, b)
  479. #define Gpio(a, b) _lfss(138, a, b)
  480. #define Devconnect(a, b, c, d, e) _lfsssss(139, a, b, c, d, e)
  481. #define Sndstatus(a) _lfs(140, a)
  482. #define Buffptr(a) _lfS(141, a)
  483.  
  484. #else /* !__LATTICE__ */
  485.  
  486. #define Locksnd()                            \
  487.     (long)trap_14_w((short)128)
  488. #define Unlocksnd()                            \
  489.     (long)trap_14_w((short)129)
  490. #define Setbuffer(region,beg,end)                    \
  491.     (long)trap_14_wwll((short)131,(short)(region),(long)(beg),(long)(end))
  492. #define Soundcmd(mode,data)                        \
  493.     (long)trap_14_www((short)130,(short)(mode),(short)(data))
  494. #define Setmode(stereo_mode)                        \
  495.     (long)trap_14_ww((short)132,(short)(stereo_mode))
  496. #define Settracks(play,rec)                        \
  497.     (long)trap_14_www((short)133,(short)(play),(short)(rec))
  498. #define Setmontracks(montrack)                        \
  499.     (long)trap_14_ww((short)134,(short)(montrack))
  500. #define Setinterrupt(src_inter,cause)                    \
  501.     (long)trap_14_www((short)135,(short)(src_inter),        \
  502.         (short)(cause))
  503. #define Buffoper(mode)                            \
  504.     (long)trap_14_ww((short)136,(short)(mode))
  505. #define Dsptristate(dspxmit,dsprec)                    \
  506.     (long)trap_14_www((short)137,(short)(dspxmit),            \
  507.         (short)(dsprec))
  508. #define Gpio(mode,data)                            \
  509.     (long)trap_14_www((short)138,(short)(mode),(short)(data))
  510. #define Devconnect(src,dst,sclk,pre,proto)                \
  511.     (long)trap_14_wwwwww((short)139,(short)(src),(short)(dst),    \
  512.         (short)(sclk),(short)(pre),(short)(proto))
  513. #define Sndstatus(reset)                        \
  514.     (long)trap_14_ww((short)140,(short)(reset))
  515. #define Buffptr(ptr)                            \
  516.     (long)trap_14_wl((short)141,(long)(ptr))
  517.  
  518. #endif /* __LATTICE__ */
  519.  
  520. /*
  521.  * DSP functions
  522.  *
  523.  * Don't even *think* of trying to use these without the manual!
  524.  */
  525.  
  526. #ifdef __LATTICE__
  527.  
  528. #define Dsp_DoBlock(a, b, c, d) _vfplpl(96, a, b, c, d)
  529. #define Dsp_BlkHandShake(a, b, c, d) _vfplpl(97, a, b, c, d)
  530. #define Dsp_BlkUnpacked(a, b, c, d) _vfplpl(98, a, b, c, d)
  531. #define Dsp_InStream(a, b, c, d) _vfplll(99, a, b, c, d)
  532. #define Dsp_OutStream(a, b, c, d) _vfplll(100, a, b, c, d)
  533. #define Dsp_IOStream(a, b, c, d, e, f) _vfppllll(101, a, b, c, d, e, f)
  534. #define Dsp_RemoveInterrupt(a) _vfs(102, a)
  535. #define Dsp_GetWordSize() _sfv(103)
  536. #define Dsp_Lock() _sfv(104)
  537. #define Dsp_Unlock() _vfv(105)
  538. #define Dsp_Available(a, b) _vfll(106, a, b)
  539. #define Dsp_Reserve(a, b) _vfll(107, a, b)
  540. #define Dsp_LoadProg(a, b, c) _sflsp(108, a, b, c)
  541. #define Dsp_ExecProg(a, b, c) _vfpls(109, a, b, c)
  542. #define Dsp_ExecBoot(a, b, c) _vfpls(110, a, b, c)
  543. #define Dsp_LodToBinary(a, b) _vflp(111, a, b)
  544. #define Dsp_TriggerHC(a) _vfs(112, a)
  545. #define Dsp_RequestUniqueAbility() _sfv(113)
  546. #define Dsp_GetProgAbility() _sfv(114)
  547. #define Dsp_FlushSubroutines() _sfv(115)
  548. #define Dsp_LoadSubroutine(a, b, c) _sfpls(116, a, b, c)
  549. #define Dsp_InqSubrAbility(a) _sfs(117, a)
  550. #define Dsp_RunSubroutine(a) _sfs(118, a)
  551. #define Dsp_Hf0(a) _sfs(119, a)
  552. #define Dsp_Hf1(a) _sfs(120, a)
  553. #define Dsp_Hf2() _sfv(121)
  554. #define Dsp_Hf3() _sfv(122)
  555. #define Dsp_BlkWords(a, b, c, d) _vfplpl(123, a, b, c, d)
  556. #define Dsp_BlkBytes(a, b, c, d) _vfplpl(124, a, b, c, d)
  557. #define Dsp_Hstat() _bfv(125)
  558. #define Dsp_SetVectors(a, b) _vfll(126, a, b)
  559. #define Dsp_MultBlocks(a, b, c, d) _vfllpp(127, a, b, c, d)
  560.  
  561. #else /* !__LATTICE__ */
  562.  
  563. #define    Dsp_DoBlock(data_in,size_in,data_out,size_out)            \
  564.     (void)trap_14_wllll((short)96,(long)(data_in),(long)(size_in),    \
  565.         (long)(data_out),(long)(size_out))
  566. #define    Dsp_BlkHandShake(data_in,size_in,data_out,size_out)        \
  567.     (void)trap_14_wllll((short)97,(long)(data_in),(long)(size_in),    \
  568.         (long)(data_out),(long)(size_out))
  569. #define    Dsp_BlkUnpacked(data_in,size_in,data_out,size_out)        \
  570.     (void)trap_14_wllll((short)98,(long)(data_in),(long)(size_in),    \
  571.         (long)(data_out),(long)(size_out))
  572. #define    Dsp_BlkWords(data_in,size_in,data_out,size_out)            \
  573.     (void)trap_14_wllll((short)123,(long)(data_in),(long)(size_in),    \
  574.         (long)(data_out),(long)(size_out))
  575. #define    Dsp_BlkBytes(data_in,size_in,data_out,size_out)            \
  576.     (void)trap_14_wllll((short)124,(long)(data_in),(long)(size_in),    \
  577.         (long)(data_out),(long)(size_out))
  578. #define    Dsp_MultBlocks(numsend,numrecv,sendblks,recvblks)        \
  579.     (void)trap_14_wllll((short)127,(long)(numsend),(long)(numrecv),    \
  580.         (long)(sendblks),(long)(recvblks))
  581. #define    Dsp_InStream(data_in,blksiz,numblks,blksdone)            \
  582.     (void)trap_14_wllll((short)99,(long)(data_in),(long)(blksiz),    \
  583.         (long)(numblks),(long)(blksdone))
  584. #define    Dsp_OutStream(data_out,blksiz,numblks,blksdone)            \
  585.     (void)trap_14_wllll((short)100,(long)(data_out),(long)(blksiz),    \
  586.         (long)(numblks),(long)(blksdone))
  587. #define    Dsp_IOStream(data_in,data_out,blkisiz,blkosiz,numblks,blksdone)    \
  588.     (void)trap_14_wllllll((short)101,(long)(data_in),(long)(data_out),\
  589.         (long)(blkisiz),(long)(blkosiz),(long)(numblks),    \
  590.         (long)(blksdone))
  591. #define    Dsp_SetVectors(rcvr,xmtr)                    \
  592.     (void)trap_14_wll((short)126,(long)(rcvr),(long)(xmtr))
  593. #define    Dsp_RemoveInterrupts(mask)                    \
  594.     (void)trap_14_ww((short)102,(short)(mask))
  595. #define    Dsp_GetWordSize()    (short)trap_14_w((short)103)
  596. #define    Dsp_Lock()        (short)trap_14_w((short)104)
  597. #define    Dsp_Unlock()        (void)trap_14_w((short)105)
  598. #define    Dsp_Available(xmem,ymem)                    \
  599.     (void)trap_14_wll((short)106,(long)(xmem),(long)(ymem))
  600. #define    Dsp_Reserve(xmem,ymem)                        \
  601.     (short)trap_14_wll((short)107,(long)(xmem),(long)(ymem))
  602. #define    Dsp_LoadProg(file,ability,buffer)                \
  603.     (short)trap_14_wlwl((short)108,(long)(file),(short)(ability),    \
  604.         (long)(buffer))
  605. #define    Dsp_ExecProg(codeptr,codesiz,ability)                \
  606.     (void)trap_14_wllw((short)109,(long)(codeptr),(long)(codesiz),    \
  607.         (short)(ability))
  608. #define    Dsp_ExecBoot(codeptr,codesiz,ability)                \
  609.     (void)trap_14_wllw((short)110,(long)(codeptr),(long)(codesiz),    \
  610.         (short)(ability))
  611. #define    Dsp_LodToBinary(file,codeptr)                    \
  612.     (long)trap_14_wll((short)111,(long)(file),(long)(codeptr))
  613. #define    Dsp_TriggerHC(vector)                        \
  614.     (void)trap_14_ww((short)112,(short)(vector))
  615. #define    Dsp_RequestUniqueAbility()    (short)trap_14_w((short)113)
  616. #define    Dsp_GetProgAbility()        (short)trap_14_w((short)114)
  617. #define    Dsp_FlushSubroutines()        (void)trap_14_w((short)115)
  618. #define    Dsp_LoadSubroutine(ptr,siz,ability)                \
  619.     (short)trap_14_wllw((short)116,(long)(ptr),(long)(siz),        \
  620.         (short)(ability))
  621. #define    Dsp_InqSubrAbility(ability)                    \
  622.     (short)trap_14_ww((short)117,(short)(ability))
  623. #define    Dsp_RunSubroutine(handle)                    \
  624.     (short)trap_14_ww((short)118,(short)(handle))
  625. #define    Dsp_Hf0(flag)                            \
  626.     (short)trap_14_ww((short)119,(short)(flag))
  627. #define    Dsp_Hf1(flag)                            \
  628.     (short)trap_14_ww((short)120,(short)(flag))
  629. #define    Dsp_Hf2()        (short)trap_14_w((short)121)
  630. #define    Dsp_Hf3()        (short)trap_14_w((short)122)
  631. #define    Dsp_HStat()        (char)trap_14_w((short)125)
  632.  
  633. #endif /* __LATTICE__ */
  634.  
  635. #endif /* _FALCON_H */
  636.